<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('计划时间')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            关键字：<input type="text" placeholder="关键字" name="keyWords"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true" style="white-space: nowrap"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('workerOrderIssueTime:edit')}]];
    var removeFlag = [[${@permission.hasPermi('workerOrderIssueTime:remove')}]];
    var prefix = ctx + "workerOrderIssueTime";

    $(function () {
        var options = {
            url: prefix + "/findList",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "计划时间",
            columns: [
                {
                    field: 'id',
                    title: 'id',
                    align: 'center',
                    visible: false
                },
                {
                    field: 'firstTime',
                    title: '工单下发时间一',
                    align: 'center',
                    visible: true,
                    formatter: function(value, row, index){
                        return value.slice(0, 8)
                    }
                },
                {
                    field: 'secondTime',
                    title: '工单下发时间二',
                    align: 'center',
                    visible: true,
                    formatter: function(value, row, index){
                        return value.slice(0, 8)
                    }
                },
                {
                    field: 'thirdTime',
                    title: '工单下发时间三',
                    align: 'center',
                    visible: true,
                    formatter: function(value, row, index){
                        return value.slice(0, 8)
                    }
                },
                {
                    field: 'fourthTime',
                    title: '工单下发时间四',
                    align: 'center',
                    visible: true,
                    formatter: function(value, row, index){
                        return value.slice(0, 8)
                    }
                },
                {
                    field: 'fifthTime',
                    title: '工单下发时间五',
                    align: 'center',
                    visible: true,
                    formatter: function(value, row, index){
                        return value.slice(0, 8)
                    }
                },
                {
                    field: 'sixthTime',
                    title: '工单下发时间六',
                    align: 'center',
                    visible: true,
                    formatter: function(value, row, index){
                        return value.slice(0, 8)
                    }
                },
                {
                    field: 'autoExecute',
                    title: '是否按指定时间执行工单任务',
                    align: 'center',
                    visible: true,
                    formatter: function(value, row, index){
                        if(value == 1){
                            return "是";
                        }else{
                            return "否";
                        }
                    }
                },
                {
                    field: 'lockTime',
                    title: '锁定时间（分钟）',
                    align: 'center',
                    visible: true
                },
                {
                    field: 'operationSeqnum',
                    title: '工序号',
                    align: 'center',
                    visible: true
                },
                {
                    field: 'sluggishExportDate',
                    title: '呆滞过期查询周期',
                    align: 'center',
                    visible: true,
                    formatter: function(value, row, index){
                        if(value != null){
                            return "每月" + value + "号";
                        }else{
                            return "-";
                        }
                    }
                },
                {
                    field: 'sluggishExportParam',
                    title: '呆滞过期查询条件',
                    align: 'center',
                    visible: true,
                    formatter: function(value, row, index){
                        if(value == 1){
                            return "到货四个月未使用";
                        }else if(value == 2){
                            return "有效期少于180天";
                        }
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index){
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
